home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
emsif24a.zip
/
EMSIF.DOC
next >
Wrap
Text File
|
1993-06-27
|
58KB
|
1,259 lines
EMSIF
Version-independent C Interface to LIM EMS Functions
for LIM EMS versions 3.0 and higher
EMSIF version 2.4
by James W. Birdsall
06/27/93
0. CONTENTS
-----------
0. CONTENTS
I. INTRODUCTION
I.1 WHAT IS SUPPORTED
I.2 COPYRIGHT, LICENSE, AND WARRANTY DISCLAIMER
II. USING EMSIF
II.1 COMPILING AND LINKING WITH THE LIBRARIES
II.2 EMSTEST, THE EXAMPLE PROGRAM
III. PROGRAMMING WITH EMSIF
III.1 INITIALIZING THE LIBRARY
III.2 ORDINARY USE
III.3 FRAME CACHING AND ALIASING
III.4 SAVE/RESTORE
III.5 OTHER TIPS
III.6 FUNCTION GROUPING
IV. LIBRARY REFERENCE
IV.1 GLOBAL VARIABLES
IV.2 FUNCTIONS
V. ERROR CODES
V.1 INTERNAL ERRORS
V.2 EMS DRIVER ERRORS
VI. THE END
VI.1 ACKNOWLEDGEMENTS
VI.2 TRADEMARKS
I. INTRODUCTION
---------------
EMSIF provides a high-level interface to LIM EMS control functions
for common operations such as allocating, mapping, and freeing EMS, and
copying data to and from EMS. The interface has been made independent of
the EMS version implemented by the EMS driver as far as possible, so
that parameters and returned data are always in the same format, but the
EMS call most appropriate to the EMS version implemented by the driver
is used.
EMSIF is written in assembly language for speed and compactness and
assembled with Borland's Turbo Assembler (TASM) 2.5. The source code is
not compatible with the Microsoft Assembler (MASM).
I.1 WHAT IS SUPPORTED
---------------------
EMSIF expressly supports the Lotus-Intel-Microsoft (LIM) Expanded
Memory Specification (EMS) versions 3.0, 3.2, and 4.0. Versions above
4.0 are supported as 4.0. Versions below 3.0 are not supported.
Save/restore is not supported under version 3.0, and assigning names to
EMS handles and unmapping logical pages are only supported under version
4.0. These exceptions to version-independence are due to limitations of
the unsupported versions; the necessary services are not available from
the driver.
EMSIF supports tiny, small, medium, compact, large, and huge memory
models. The small model library supports both tiny and small models, so
no library is provided specifically for tiny model.
EMSIF supports any version of Turbo C, Turbo C++, or Borland C++, in
both C and C++ modes, and Microsoft C 6.00 and above. This version of
EMSIF has been tested with Borland C++ 2.0, Turbo C 2.0, Microsoft C 7.0
and 8.0 (in Microsoft Visual C++ 1.0) in all of the supported memory
models. EMSIF should work with earlier versions of Microsoft C and any
other C compiler that 1) uses compatible parameter passing and return
methods and 2) can use standard-format libraries.
I.2 COPYRIGHT, LICENSE, AND WARRANTY DISCLAIMER
-----------------------------------------------
EMSIF is not in the public domain. All the files are copyright 1991,
1992, 1993 by James W. Birdsall, all rights reserved. Permission is
granted to do the following:
You may freely redistribute this archive, so long as it contains
all the files listed in the file MANIFEST, intact and
unmodified.
You may use the libraries in programs for your own use. You may
not distribute programs linked with these libraries.
Payment of the $5 shareware registration fee ($50 for commercial use)
grants the following license, in addition to the permissions listed
above:
You may request the source to EMSIF. You may modify the source
as necessary for use in your programs. However, you may not
redistribute either the original or modified source.
You may distribute programs linked with either the original
libraries or libraries generated from source you have modified,
without royalty, provided you (a) do not alter or remove
copyright notices contained therein and (b) you indemnify, hold
harmless, and defend the author from and against any claims or
lawsuits, including attorney's fees, that arise or result from
the use or distribution of your software product.
For the purposes of this license, commercial use is defined as use by an
incorporated entity in a software product that is regarded as the
product of the corporation, no matter how the software product is
distributed, but only if 100 or more copies of the product are expected
to be made.
The contents of the distribution archive, and all other related
files, information, and services are provided "as is" and without
warranty. To the extent permitted by applicable law, the author
disclaims all warranties, express or implied, including but not limited
to, any implied warranty of merchantability or fitness for a particular
purpose. While effort has been made to ensure that the files, information,
and services are accurate and correct, the author shall not be liable
for damages arising out of the use of or inability to use this product,
including but not limited to, loss of profit, data, or use of this
software, or special, incidental, or consequential damages or other
similar claims, even if the author has been specifically advised of the
possibility of such damages. Some states do not allow the exclusion of
incidental or consequential damages, so the foregoing limitation may not
apply to you.
Information on contacting the author is provided at the end of this
file.
II. USING EMSIF
---------------
This section describes how to use the EMSIF libraries with your
programs.
II.1 COMPILING AND LINKING WITH THE LIBRARIES
---------------------------------------------
EMSIF is provided as Borland/Microsoft standard library files.
Libraries are provided for small, medium, compact, large, and huge
memory models (tiny model uses the small model library). The model for
which a library is intended is indicated by the last letter of the
filename proper, which is the same as the first letter for the model.
For example, EMSIFL.LIB is the large model library.
To use EMSIF, you must #include the file EMSIF.H in every source file
that calls EMSIF functions, accesses EMSIF global variables, or uses
#defined constants provided by EMSIF. The same EMSIF.H file supports
both C and C++.
The procedures for linking EMSIF with the rest of your program vary
according to the compiler and method you are using. In general, you must
include the appropriate library (the library corresponding to the memory
model in which you have compiled the rest of your program) in the link.
If you are compiling in the Integrated Development Environment of
Turbo/Borland C[++] or Microsoft Visual C++, include the name of the
appropriate library in the project file for your program. For example,
if you are working in the compact memory model, include EMSIFC.LIB in
your project file.
If you are using a command-line compiler (bcc, tcc, or cl) to compile
and link, simply place the full name of the appropriate EMSIF library on
the command line. For example, "bcc -mc foo.c emsifc.lib" will compile
the file "foo.c" in the compact model and link it with emsifc.lib.
If you are linking manually (using TLINK or LINK), place the name of
the appropriate library in with the other libraries. For example,
tlink c0c.obj foo.obj, foo.exe, foo.map, cc.lib emsifc.lib
or
link foo.obj, foo.exe, foo.map, emsifc.lib ;
will link the object "foo.obj" with the appropriate startup object and
standard library (LINK automatically includes the startup object and
standard library, so it is not necessary to explicitly include them) and
the compact model EMSIF library.
II.2 EMSTEST, THE EXAMPLE PROGRAM
---------------------------------
A large and complete example program and tester, EMSTEST, has been
included in this distribution. It can be compiled in any of the
supported memory models (although ti